The present invention relates to a data writing/reading device of a camera, in particular, relates to a data writing/reading device for writing data to a non-volatile memory E.sup.2 PROM (Electronic Erasable and Programmable ROM) and reading data from the E.sup.2 PROM.
In some cameras of the present, an electrically rewritable non-volatile memory E.sup.2 PROM are used for the purpose of storing data such as the number of frames of a film in case a power source is used up, such as exhaustion of a battery. When an E.sup.2 PROM is used, generally a method which fixes an address for the data to always use the same memory area is applied. When rewriting of data is conducted in the same memory area of a fixed address, since there is a limit in the number in rewritings of one memory area of an E.sup.2 PROM, there is a fear that correct writing of data might become impossible after frequent rewritings of data. Also, even within the limit of the number of rewritings, there is a fear that correct writing of data in the memory area might become impossible due to certain anomaly. If such a condition is caused, it is not possible to obtain correct data even if a fresh battery is loaded to a camera, and it would result in a serious hindrance to a systematic operation of the camera.
In an ordinary camera, a backup capacitor is provided for backing up a power source only for a short time in case a battery is removed or exhausted. In case of a camera like this, when the battery is removed or exhausted in the midst of writing data to an E.sup.2 PROM, the power source is backed up by the backup capacitor and the writing of data to the E.sup.2 PROM is continued. However, as a writing current of the E.sup.2 PROM is as large as2 mA, there is a fear that it might not possible to back up the power source during the writing to the E.sup.2 PROM and the writing of data might not be finished completely. If a writing to the E.sup.2 PROM is caused during a backup of the power is being supplied by the backup capacitor, writing errors of data occurs very often. That is, there is a fear that errors might occur in writing of data to the E.sup.2 PROM. If such a condition is caused, it is not possible to obtain correct data even when the battery is loaded to a camera, and it would also result in a serious hindrance to a systematic operation of the camera.